package com.wlf.service;

import com.wlf.entity.ElasticSearchRequest;
import com.wlf.entity.User;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.update.UpdateResponse;

/**
* @author 作者 危凌峰:
* @version 创建时间：2021年4月28日 上午9:36:19
*/
public interface IElasticSearchService {

	/**
	 * 保存
	 * @param request
	 * @return
	 */
	IndexResponse save(ElasticSearchRequest<?> request) throws Exception;

	/**
	 * 删除
	 * @param request
	 * @return
	 */
	DeleteResponse delete(ElasticSearchRequest<?> request) throws Exception;

	/**
	 * 局部更新
	 * @param request
	 * @return
	 */
	UpdateResponse partialUpdate(ElasticSearchRequest<?> request) throws Exception;

	/**
	 * 全量更新
	 * @param request
	 * @return
	 */
	IndexResponse update(ElasticSearchRequest<?> request) throws Exception;

	/**
	 * 查询
	 * @param request
	 * @return
	 */
	GetResponse query(ElasticSearchRequest<?> request) throws Exception;

}
